//
//  MHConstant.h
// MiaoCircle
//
//Created by acgera on 2018/4/9.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

/// Block
///------
typedef void (^VoidBlock)(void);
typedef BOOL (^BoolBlock)(void);
typedef int  (^IntBlock) (void);
typedef id   (^IDBlock)  (void);

typedef void (^VoidBlock_int)(int);
typedef BOOL (^BoolBlock_int)(int);
typedef int  (^IntBlock_int) (int);
typedef id   (^IDBlock_int)  (int);

typedef void (^VoidBlock_string)(NSString *);
typedef BOOL (^BoolBlock_string)(NSString *);
typedef int  (^IntBlock_string) (NSString *);
typedef id   (^IDBlock_string)  (NSString *);

typedef void (^VoidBlock_id)(id);
typedef BOOL (^BoolBlock_id)(id);
typedef int  (^IntBlock_id) (id);
typedef id   (^IDBlock_id)  (id);

typedef void (^VoidBlock_id_id)(id,id);

typedef void (^VoidBlock_id_int)(id, int);


typedef void (^VoidBlock_bool)(BOOL);


#pragma mark - 应用相关的

FOUNDATION_EXTERN NSString * const  MHVideoLoadMusicNotification;

/// 切换根控制器的通知 新特性
FOUNDATION_EXTERN NSString * const MHSwitchRootViewControllerNotification;

FOUNDATION_EXTERN NSString * const MHPushTextNotification;


FOUNDATION_EXTERN NSString * const MHReloadDiscoverHomeCircleDataNotification;

FOUNDATION_EXTERN NSString * const MHReloadFirstPageDataNotification;


FOUNDATION_EXTERN NSString * const MHReloadFirstPageReloadDataNotification;

FOUNDATION_EXTERN NSString *const MHChacheIMGroupLastMessage;

FOUNDATION_EXTERN NSString * const MHReloadHomeDiscoverDataNotification;

FOUNDATION_EXTERN NSString * const MHReloadMomentPageDataNotification;

FOUNDATION_EXTERN NSString * const MHReloadMomentSecondPageDataNotification;

FOUNDATION_EXTERN NSString * const MHRefreshChatCellNotification;

FOUNDATION_EXTERN NSString * const MHCircleHomeUpdateNotification;

FOUNDATION_EXTERN NSString * const  MHUpdateCurrentLocationNotification;


FOUNDATION_EXTERN NSString * const MHRedPacketPaySuccessNotification;


FOUNDATION_EXTERN  NSString * const MHRedPacketReceviceNotification;

/// 切换根控制器的通知 UserInfo key
FOUNDATION_EXTERN NSString * const MHSwitchRootViewControllerUserInfoKey;

/// 插件Switch按钮值改变
FOUNDATION_EXTERN NSString * const MHPlugSwitchValueDidChangedNotification;


FOUNDATION_EXTERN NSString * const MHRefreshRealthToMeNotification;


FOUNDATION_EXTERN NSString * const MHTiXianSuccessNotification;

FOUNDATION_EXTERN NSString * const MHIMLoginSuccessNotification;

FOUNDATION_EXTERN NSString * const SEARCH_CANCEL_NOTIFICATION_KEY ;


//FOUNDATION_EXTERN NSString * const  MHRefreshPushDataNotification;


/// 全局分割线高度 .5
FOUNDATION_EXTERN CGFloat const MHGlobalBottomLineHeight;

/// 全局底部距离 20
FOUNDATION_EXTERN CGFloat const MHGlobalBottomMarginHeight;

/// 个性签名的最大字数为30
FOUNDATION_EXTERN NSUInteger const MHFeatureSignatureMaxWords;

/// 用户昵称的最大字数为20
FOUNDATION_EXTERN NSUInteger const MHNicknameMaxWords;



FOUNDATION_EXTERN NSString * const MHMyDetailMomentUrl;

/// 国家区号
FOUNDATION_EXTERN NSString * const MHMobileLoginZoneCodeKey ;
/// 手机号码
FOUNDATION_EXTERN NSString * const MHMobileLoginPhoneKey ;


FOUNDATION_EXTERN NSString *const MHViewModelIsFinisedKey;

/// 验证码时间
FOUNDATION_EXTERN NSUInteger const MHCaptchaFetchMaxWords;




FOUNDATION_EXTERN NSString *const MHCirclePriceRange;


FOUNDATION_EXTERN NSString *const MHUploadedLocation;



#define MHRealHeightValue(value) ((value)/667.0f*[UIScreen mainScreen].bounds.size.height)
/// 全局细下滑线颜色 以及分割线颜色
#define WXGlobalBottomLineColor     [UIColor colorFromHexString:@"#e8e8e8"]
/// 全局黑色字体
#define WXGlobalBlackTextColor      [UIColor colorFromHexString:@"#333333"]
/// 全局灰色背景
#define WXGlobalGrayBackgroundColor [UIColor colorFromHexString:@"#EFEFF4"]
/// 全局分割线高度
FOUNDATION_EXTERN CGFloat const WXGlobalBottomLineHeight;



FOUNDATION_EXTERN CGFloat const MHCircleNmaeMaxTextLength;

FOUNDATION_EXTERN CGFloat const MHCircleInfoMaxTextLength;


/// 微信朋友圈常量定义区
/// 头像宽高 15
FOUNDATION_EXTERN CGFloat const MHMomentProfileViewAvatarViewWH;
/// 消息tips宽高 40
FOUNDATION_EXTERN CGFloat const MHMomentProfileViewTipsViewHeight ;
/// 消息tips宽高 181
FOUNDATION_EXTERN CGFloat const MHMomentProfileViewTipsViewWidth ;
/// 消息tipsView内部的头像宽高 30
FOUNDATION_EXTERN CGFloat const MHMomentProfileViewTipsViewAvatarWH ;
/// 消息tipsView内部的头像距离tipsView边距 5
FOUNDATION_EXTERN CGFloat const MHMomentProfileViewTipsViewInnerInset ;
/// 消息tipsView内部的右箭头距离tipsView边距 11
FOUNDATION_EXTERN CGFloat const MHMomentProfileViewTipsViewRightInset ;
/// 消息tipsView内部的右箭头宽高 15
FOUNDATION_EXTERN CGFloat const MHMomentProfileViewTipsViewRightArrowWH ;


FOUNDATION_EXTERN CGFloat const MHDefulatCellImageWidth;



FOUNDATION_EXTERN CGFloat const MHDefulatCellNetWorkImgeWidth;

//// 朋友圈说说
/// 说说内容距离顶部的间距 16
FOUNDATION_EXTERN CGFloat const MHMomentContentTopInset;
/// 说说内容距离左右屏幕的间距 20
FOUNDATION_EXTERN CGFloat const MHMomentContentLeftOrRightInset;

FOUNDATION_EXTERN CGFloat const MHMomentHeaderBottomBarHeight;
/// 内容（控件）之间的的间距 10
FOUNDATION_EXTERN CGFloat const MHMomentContentInnerMargin;
/// 用户头像的大小 44x44
FOUNDATION_EXTERN CGFloat const MHMomentAvatarWH;

/// 向上箭头W
FOUNDATION_EXTERN CGFloat const MHMomentUpArrowViewWidth ;
/// 向上箭头H
FOUNDATION_EXTERN CGFloat const MHMomentUpArrowViewHeight ;

/// 全文、收起W
FOUNDATION_EXTERN CGFloat const MHMomentExpandButtonWidth ;
/// 全文、收起H
FOUNDATION_EXTERN CGFloat const MHMomentExpandButtonHeight ;

FOUNDATION_EXTERN NSString *const MHCacheGlobleKey;

FOUNDATION_EXTERN NSString *const MHH5LinksKey;

FOUNDATION_EXTERN NSString *const  MHIllegalList;

FOUNDATION_EXTERN NSString *const MHRedPacketConfig;




/// pictureView中图片之间的的间距 6
FOUNDATION_EXTERN CGFloat const MHMomentPhotosViewItemInnerMargin;
/// pictureView中图片的大小 86x86 (屏幕尺寸>320)
FOUNDATION_EXTERN CGFloat const MHMomentPhotosViewItemWH1;
/// pictureView中图片的大小 70x70 (屏幕尺寸<=320)
FOUNDATION_EXTERN CGFloat const MHMomentPhotosViewItemWH2;

/// 分享内容高度
FOUNDATION_EXTERN CGFloat const MHMomentShareInfoViewHeight;

/// videoView高度
FOUNDATION_EXTERN CGFloat const MHMomentVideoViewHeight ;
/// videoView宽度
FOUNDATION_EXTERN CGFloat const MHMomentVideoViewWidth ;


/// 微信正文内容的显示最大行数（PS：如果超过最大值，那么正文内容就单行显示，可以点击正文内容查看全部内容）
FOUNDATION_EXTERN NSUInteger const MHMomentContentTextMaxCriticalRow ;
/// 微信正文内容显示（全文/收起）的临界行
FOUNDATION_EXTERN NSUInteger const MHMomentContentTextExpandCriticalRow ;

/// pictureView最多显示的图片数
FOUNDATION_EXTERN NSUInteger const MHMomentPhotosMaxCount ;
/// pictureView显示图片的最大列数
#define MHMomentMaxCols(__photosCount) ((__photosCount==4)?2:3)


/// 微信昵称字体大小
#define MHMomentScreenNameFont MHRegularFont_15
/// 微信正文字体大小
#define MHMomentContentFont  MHRegularFont_16
/// 微信地址+时间+来源的字体大小
#define MHMomentCreatedAtFont MHRegularFont_12
/// 微信（全文/收起）字体大小
#define MHMomentExpandTextFont MHRegularFont_15
/// 微信评论正文字体大小
#define MHMomentCommentContentFont MHRegularFont_14
/// 微信评论的昵称的字体大小
#define MHMomentCommentScreenNameFont  MHRegularFont_14



#define MHTextColor333 [UIColor colorFromHexString:@"#3333333"]
#define MHTextColor000 [UIColor colorFromHexString:@"#000000"]
#define MHTextColor7D [UIColor colorFromHexString:@"#7d7d7d"]
#define MHTextColorC7 [UIColor colorFromHexString:@"#C7C7C7"]


#define MHTextColorDD [UIColor colorFromHexString:@"#DD2B2C"] 

#define MHTextColorF75 [UIColor colorFromHexString:@"#F75260"]

#define MHTextColorF6F6F6 [UIColor colorFromHexString:@"#F6F6F6"]

#define MHTextColor4ABC6A [UIColor colorFromHexString:@"#4ABC6A"]
#define MHTextColor3AA [UIColor colorFromHexString:@"#3AA75E"]
#define MHTextColorAAA [UIColor colorFromHexString:@"#aaaaaa"]
#define MHTextColor7281A6 [UIColor colorFromHexString:@"#7281A6"]


#define MHBGColorLikeGray  MHColor(244, 244, 244)



#define MHTextColor127 MHColor(127, 127, 127)


#define MHMediumFont14  MHMediumFont(14.0f)



//******************************背景颜色******************************
#define MHPureWhiteBackgroundColor [UIColor colorFromHexString:@"#ffffff"]
#define MHGlobleWhiteBackGroundColor [UIColor colorFromHexString:@"#f8f8f8"]

//******************************分割线颜色******************************
#define MHSpliteLineColor [UIColor colorFromHexString:@"#E8E8E8"]
#define MHTopBottomSpliteLineColor [UIColor colorFromHexString:@"#bdbdbd"]



#define MHCircleShadowColor [UIColor colorFromHexString:@"#465367"]

#define MHYellowColor [UIColor colorFromHexString:@"#ffda44"]
//******************************文字颜色******************************
#define MHWhiteTextColor [UIColor colorFromHexString:@"#FFFFFF"]

#define MHWhiteBgColor [UIColor colorFromHexString:@"#FFFFFF"]
//深灰-辅助、提示性文字
#define MHMetionTextColor [UIColor colorFromHexString:@"#999999"]
//深黒-辅助、默认状态文字、弹框正文文字
#define MHAlertTextColor [UIColor colorFromHexString:@"#666666"]
//黑色-标题、正文、金额等主要文字
#define MHMainTextColor [UIColor colorFromHexString:@"#333333"]
//红色-重要醒目、点击状态文字
#define MHRedTextColor [UIColor colorFromHexString:@"#ec725d"]

#define MHBGColorD8 [UIColor colorFromHexString:@"#D85042"]
//蓝色-用户名、查看全文、链接文字、点赞
#define MHLinkTextColor [UIColor colorFromHexString:@"#7281a6"]
//绿色-标签文字、弹框按钮文字
#define MHAlertButtonTextColor [UIColor colorFromHexString:@"#3aa65e"]

#define MHDisableBgColor [UIColor colorFromHexString:@"#eeeeee"]

//******************************图标颜色******************************

//******************************按钮颜色******************************
//置灰、不能点击
#define MHButtonDisableBgColor [UIColor colorFromHexString:@"#bdbdbd"]
//默认按钮、付费圈子按钮
#define MHButtonRedBgColor [UIColor colorFromHexString:@"#ec725d"]
//免费圈子按钮
#define MHButtonBlueBgColor [UIColor colorFromHexString:@"#7eb4f2"]

#define MHTEXTCOLORF2 [UIColor colorFromHexString:@"#F2F2F2"]



/// 动态昵称颜色
#define MHMomentScreenNameTextColor2 [UIColor colorFromHexString:@"#F68A6D"]
#define MHMomentScreenNameTextColor [UIColor colorFromHexString:@"#7281a6"]//

#define MHMomentAskTextColor [UIColor colorFromHexString:@"#999999"]

/// 微信正文（链接、电话）的颜色
#define MHMomentContentUrlTextColor [UIColor colorFromHexString:@"#4380D1"]
/// 微信正文字体颜色
#define MHMomentContentTextColor WXGlobalBlackTextColor
/// 微信时间颜色
#define MHMomentCreatedAtTextColor [UIColor colorFromHexString:@"#737373"]



/// 点击文字高亮的颜色
#define MHMomentTextHighlightBackgroundColor [UIColor colorFromHexString:@"#C7C7C7"]



/// 单张图片的最大高度（等比例）180 (ps：别问我为什么，我量出来的)
FOUNDATION_EXTERN CGFloat const MHMomentPhotosViewSingleItemMaxHeight;


/// 更多按钮宽高 (实际：25x25)
FOUNDATION_EXTERN CGFloat const MHMomentOperationMoreBtnWH ;


/// footerViewHeight
FOUNDATION_EXTERN CGFloat const MHMomentFooterViewHeight;

FOUNDATION_EXTERN CGFloat const MHVideoRecordBeautyLevel;

FOUNDATION_EXTERN CGFloat const MHVideoRecordWhiteLevel;

FOUNDATION_EXTERN CGFloat const MHVideoRecordRedLevel;


FOUNDATION_EXTERN CGFloat const MHVideoBitratePIN;

FOUNDATION_EXTERN CGFloat const MHVideoRecordFilterLevel;

//// 评论和点赞view 常量
/// 评论内容距离顶部的间距 5
FOUNDATION_EXTERN CGFloat const MHMomentCommentViewContentTopOrBottomInset;
/// 评论内容距离评论View左右屏幕的间距 9
FOUNDATION_EXTERN CGFloat const MHMomentCommentViewContentLeftOrRightInset;
/// 点赞内容距离顶部的间距 7
FOUNDATION_EXTERN CGFloat const MHMomentCommentViewAttitudesTopOrBottomInset;

/// 评论or点赞 view的背景色
#define MHMomentCommentViewBackgroundColor [UIColor colorFromHexString:@"#F3F3F5"]
/// 评论or点赞 view的选中的背景色
#define MHMomentCommentViewSelectedBackgroundColor [UIColor colorFromHexString:@"#CED2DE"]


/// 更多操作View的Size 181x39
/// 更多操作View的Size 181x39
FOUNDATION_EXTERN CGFloat const MHMomentOperationMoreViewWidth ;
FOUNDATION_EXTERN CGFloat const MHMomentOperationMoreViewHeight ;

/// 微信动画时间 .25f
FOUNDATION_EXTERN NSTimeInterval const MHMommentAnimatedDuration;


FOUNDATION_EXTERN CGFloat const MHDefulatCellRowHeight;

FOUNDATION_EXTERN CGFloat const MHDefulatCellRowHeaderHeight;



/**
 YYTextHighlight *highlight = [YYTextHighlight new];
 highlight.userInfo = @{kWBLinkHrefName : href};
 */
//// 这里是点击文本链接（or其他）跳转，通过该key从userInfo中取出对应的数据
/// 点击链接
FOUNDATION_EXTERN NSString * const MHMomentLinkUrlKey ;
/// 电话号码key
FOUNDATION_EXTERN NSString * const MHMomentPhoneNumberKey ;
/// 点击位置
FOUNDATION_EXTERN NSString * const MHMomentLocationNameKey;
/// 点击用户昵称
FOUNDATION_EXTERN NSString * const MHMomentUserInfoKey;


/// 评论View
/** 弹出评论框View最小高度 */
FOUNDATION_EXTERN CGFloat const MHMomentCommentToolViewMinHeight;
/** 弹出评论框View最大高度 */
FOUNDATION_EXTERN CGFloat const MHMomentCommentToolViewMaxHeight ;
/** 弹出评论框View的除了编辑框的高度 */
FOUNDATION_EXTERN CGFloat const MHMomentCommentToolViewWithNoTextViewHeight;


//公共
FOUNDATION_EXTERN CGFloat const MHCommonConentInset11;
FOUNDATION_EXTERN CGFloat const MHCommonConentInset12;
FOUNDATION_EXTERN CGFloat const MHCommonConentInset13;
FOUNDATION_EXTERN CGFloat const MHCommonConentInset15;
FOUNDATION_EXTERN CGFloat const MHCommonConentInset18;



FOUNDATION_EXTERN CGFloat const MHChatContentLeftOrRightInset;

FOUNDATION_EXTERN CGFloat const  MHCommonConentSize72;

FOUNDATION_EXTERN CGFloat const  MHCommonConentSize51;

FOUNDATION_EXTERN CGFloat const  MHCommonConentSize20;

FOUNDATION_EXTERN CGFloat const  MHCommonConentSize21;

//// ---------------- inline ----------------

/// 图片的宽度 （九宫格）
static inline CGFloat MHMomentPhotosViewItemWidth(){
    CGFloat itemW = ([UIScreen mainScreen].bounds.size.width<=320)? MHMomentPhotosViewItemWH2:MHMomentPhotosViewItemWH1;
    return itemW;
}


/// 单张图片的最大宽度（方形or等比例）
static inline CGFloat MHMomentPhotosViewSingleItemMaxWidth(){
    CGFloat itemW = MHMomentPhotosViewItemWidth();
    return MHMomentPhotosViewItemInnerMargin + itemW*2;
}

/// 计算微信说说正文的limitWidth或者评论View的宽度
static inline CGFloat MHMomentCommentViewWidth() {
    return ([UIScreen mainScreen].bounds.size.width - MHMomentContentLeftOrRightInset*2 -MHMomentAvatarWH - MHMomentContentInnerMargin);
}


static inline CGFloat MHRedPacketContentRecordViewWidth() {
    return ([UIScreen mainScreen].bounds.size.width - MHCommonConentInset13*2 -MHCommonConentSize72 - MHCommonConentInset18);
}




#ifndef TCConstants_h
#define TCConstants_h

//Http配置
#define kHttpServerAddr                     @"https://xzb.qcloud.com" // @"https://roomtest.qcloud.com/lite"  //旧环境@"https://livedemo.tim.qq.com/interface.php"

//bugly组件Appid，bugly为腾讯提供的用于App Crash收集和分析的组件
#define BUGLY_APP_ID                         @"f991dc1856"

//录屏需要用到此配置,请改成您的工程配置文件中的app groups的配置

//直播分享页面的跳转地址，分享到微信、手Q后点击观看将会跳转到这个地址，请参考https://www.qcloud.com/document/product/454/8046 文档部署html5的代码后，替换成相应的页面地址
#define kLivePlayShareAddr                   @"http://imgcache.qq.com/open/qcloud/video/share/xiaozhibo.html"
//设置第三方平台的appid和appsecrect，大部分平台进行分享操作需要在第三方平台创建应用并提交审核，通过后拿到appid和appsecrect并填入这里，具体申请方式请参考http://dev.umeng.com/social/android/operation
//有关友盟组件更多资料请参考这里：http://dev.umeng.com/social/ios/quick-integration
#define kWeiXin_Share_ID                     @"wx6ae3374db9733fcc"
#define kWeiXin_Share_Secrect                @"757aeae22603e87b7843de8c4b3c3e99"

#define kSina_WeiBo_Share_ID                 @"612079538"
#define kSina_WeiBo_Share_Secrect            @"9165e82c540363d19ece52535026600d"

#define kQQZone_Share_ID                     @"101360044"
#define kQQZone_Share_Secrect                @"a78d337fc7ad4dae29272160beddab88"

#define APP_GROUP                            @"group.com.tencent.xiaoshipin"
#define BGM_GROUP                            @"group.com.tencent.bgm.list"

//**********************************************************************

#define kHttpTimeout                         30

#define kSupportNSDataCommon                1

#define kScaleY [UIScreen mainScreen].bounds.size.height / 667
#define kScaleX [UIScreen mainScreen].bounds.size.width / 375

//错误码
#define kError_InvalidParam                            -10001
#define kError_ConvertJsonFailed                       -10002
#define kError_HttpError                               -10003

#define  logoutNotification  @"logoutNotification"
//播放端错误信息
#define kErrorMsgRtmpPlayFailed @"视频流播放失败，Error:"

static NSInteger const PreloadMinCount = 4;

//是否展示log按钮，测试的时候打开，正式发布的时候关闭
#define ENABLE_LOG 0


#ifndef POD_PITU
#define POD_PITU 0
#endif

#ifndef YOUTU_AUTH
#define YOUTU_AUTH 0
#endif


#endif /* TCConstants_h */

